/*
 * JS Expertise ver 0.0.1
 * @author: Hoan Vu PHAN
 */
Jse = function () {
}

Jse.apply = function (o, c) {
    for(var i in c) {
        o[i] = c[i];
    }
}

Jse.applyIfNotExist = function (o, c) {
    for(var i in c) {
        if(o[i] !== undefined) {
            o[i] = c[i];
        }
    }
}


var ua = navigator.userAgent.toLowerCase(),
    reg = function(b){
        return b.test(ua);
    },
    DOC = document,
    docMode = DOC.documentMode,
    isStrict = DOC.compatMode == "CSS1Compat",
    isOpera = reg(/opera/),
    isChrome = reg(/\bchrome\b/),
    isWebKit = reg(/webkit/),
    isSafari = !isChrome && reg(/safari/),
    isSafari2 = isSafari && reg(/applewebkit\/4/), // unique to Safari 2
    isSafari3 = isSafari && reg(/version\/3/),
    isSafari4 = isSafari && reg(/version\/4/),
    isIE = !isOpera && reg(/msie/),
    isIE7 = isIE && (reg(/msie 7/) || docMode == 7),
    isIE8 = isIE && (reg(/msie 8/) && docMode != 7),
    isIE6 = isIE && !isIE7 && !isIE8,
    isGecko = !isWebKit && reg(/gecko/),
    isGecko2 = isGecko && reg(/rv:1\.8/),
    isGecko3 = isGecko && reg(/rv:1\.9/),
    isBorderBox = isIE && !isStrict,
    isWindows = reg(/windows|win32/),
    isMac = reg(/macintosh|mac os x/),
    isAir = reg(/adobeair/),
    isLinux = reg(/linux/),
    isSecure = /^https/i.test(window.location.protocol);
    
Jse.apply(Jse, {
    isChrome: isChrome,
    isIE: isIE
});

alert(Jse.isIE)
